<template>
	<view class="home">
		<view class="item">
			<view class="">用户的姓名:<text>{{Info.name}}</text></view>
			<view class="">取件码:<text>{{Info.get_code}}</text></view>
			<view class="">用户电话:<text>{{Info.telephone}}</text></view>
		</view>

		<button type="primary" class="button" @click="nav">确定</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Info: {},
				TaskIofo: [],
				id: 0
			}
		},
		methods: {
			async getTaskInfo() {
				const res = await this.$myRequest({
					url: 'getTaskInfo'
				})
				this.TaskIofo = res.data.message;

				for (let i = 0; i < this.TaskIofo.length; i++) {
					if (this.TaskIofo[i].id == this.id) {
						this.Info = this.TaskIofo[i];
					}
				}
			},
			nav() {
				uni.switchTab({
					url: '../../pages/order/order',
					success: () => {
						// uni.$emit('refreshGet',{msg:'发送信息'})
					}
				})
			}
		},
		onLoad(options) {
			this.id = options.id;
			this.getTaskInfo();
		}
	}
</script>

<style lang="scss">
	.home{
		width: 100%;
		.item{
			width: 100%;
			font-size: 28rpx;
			margin-top: 20px;
			
			view{
				width: 690rpx;
				height: 140rpx;
				line-height: 140rpx;
				border-bottom: 1px solid #C0C0C0;
				display: flex;
				margin: 0 auto;
				
				text{
					display: block;
					margin-left: 50rpx;
				}
			}
		}
		
		.button{
			position: fixed;
			bottom: 80rpx;
			left:50%;
			font-size: 32rpx;
			transform: translateX(-50%);
			background-color: $main-color;
			width: 90%;
		}
	}


	
</style>
